/* $RCSFile: ParametersCollection.cs $
 * Apache license v2 2011 by Christian Surieux
 * $Source: ?/ADNCRM.RulesEngine/ParametersCollection.cs $
 * $log$
 * Revision 6 2010/08/06 19:56:30  christian.surieux
 *   Added Log to All cs files
 */

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace Rewrite.NET
{
    /// <summary>
    /// Summary description for IndexesCollection
    /// </summary>
    public class ParametersCollection : ConfigurationElementCollection
    {
        public RuleParameter this[int index]
        {
            get
            {
                return base.BaseGet(index) as RuleParameter;
            }
            set
            {
                if (base.BaseGet(index) != null)
                {
                    base.BaseRemoveAt(index);
                }
                this.BaseAdd(index, value);
            }
        }


        protected override ConfigurationElement CreateNewElement()
        {
            return new RuleParameter();
        }

        protected override object GetElementKey(ConfigurationElement element)
        {
            return ((RuleParameter)element).SearchExpression;
        }
    }
}